ManagerBonusPanel = function(){
	var this_panel = this;
	
	var store =  new Ext.data.GroupingStore({
		reader : bonusReader,
		groupField:'product.type'
	});
	
	this.listeners = {
		show : function(){
			this_panel.getTopToolbar().init();
		}
	};
	ManagerBonusPanel.superclass.constructor.call(this, {
		title : "奖金发放合计(事业部经理)",
		loadMask : true,
		stripeRows : true,
		enableHdMenu : false,
		sm: new Ext.grid.RowSelectionModel({singleSelect:true}),
		 view: new Ext.grid.GroupingView({
			 	forceFit: true,
		    	hideGroupedColumn : true,
	            groupTextTpl: '{text}'
	        }),
		colModel: new Ext.grid.ColumnModel({
			defaults : {
				align : "center",
				sortable : true
			},
			columns:[{header : "事业部经理",dataIndex : "person.name", align : "left"},
			         {header : "支持产品",dataIndex : "product.type"},
			         {header : "销售金额",dataIndex : "sellSum"},
			         {header : "回款金额",dataIndex : "backSum"},
			         {header : "金额合计",dataIndex : "sellbacksum"},
			         {header : "平均金额",dataIndex : "sellbacksumhalf"},
			         {header : "销售奖",dataIndex : "sellAword",xtype:"numbercolumn", format:"0"},
			         {header : "回款奖",dataIndex : "backAword",xtype:"numbercolumn", format:"0"},
			         {header : "奖金合计",dataIndex : "sellbackAword",xtype:"numbercolumn", format:"0"},
			         {header : "平均奖金",dataIndex : "sellbackAwordhalf",xtype:"numbercolumn", format:"0"},
			         {header : "最终奖金",dataIndex : "sellbackAwordhalf",xtype:"numbercolumn", format:"0"}
			        ]
		}),
		viewConfig: {
	        forceFit: true
		},
		store :store,
		tbar : new SeasonToolbar({
			panel : this_panel,
			url : "item/bonusBySeason.action",
			type : "manager"
		})
	});
};
Ext.extend(ManagerBonusPanel, Ext.grid.GridPanel);
var managerBonusPanel = new ManagerBonusPanel();